package cn.wawi.controller.data;

import javax.servlet.http.HttpServletRequest;
import cn.wawi.common.easyui.DataGrid;
import cn.wawi.controller.BaseController;
import cn.wawi.entity.data.Curriculum;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/data_curr")
public class CurriculumController extends BaseController<Curriculum>{
	
	@InitBinder({"curriculumType","skill","grade"})
	public void initBinder(WebDataBinder binder) {
		binder.setFieldDefaultPrefix("grade.");
		binder.setFieldDefaultPrefix("skill.");
		binder.setFieldDefaultPrefix("curriculumType.");
	}
	
	@ResponseBody
	@RequestMapping(value="/list",method=RequestMethod.GET)
	public DataGrid list(HttpServletRequest request){
		return findAllByPage(request);
	}
}
